STEP 2: Let's create a loop to replace all of this inefficient code!
- Delete all the code after the second comment.
- In LOGIC, drag out Loop with Range. Change the range() to 9 so the loop runs 9 times.
- Move the code that is between the comments into the loop instead! The commands should be indented once.
You've refactored the code! Notice that the outcome is the same, but the code is much and more efficient.
To navigate the page using the TAB key, first press ESC to exit the code editor.